package com.chen.authority.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.chen.authority.common.response.SingleResponse;
import com.chen.authority.common.util.SystemUtil;
import com.chen.authority.model.bo.ServerBo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 服务器监控
 *
 * @author chengy
 * @date 2022/11/19
 */
@Api(tags = "服务器监控 ServerController")
@RestController
public class ServerController {

    @ApiOperation("获取服务器信息")
    @SaCheckPermission("monitor:server:get")
    @GetMapping("/monitor/server")
    public SingleResponse<ServerBo> getServerInfo() throws Exception {
        return SingleResponse.success(SystemUtil.getServerInfo());
    }

}
